<!DOCTYPE html>
<html>
<head>
    <title>测算情况汇总表</title>
<#include "../../common/common.ftl"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">测算情况汇总表</div>
        <div class="layui-card-body">
            <button class="layui-btn layui-btn-bg" id="excelBtn"><i
                    class="layui-icon layui-icon-export"></i>导出Excel
            </button>
            <table class="layui-table table" style="text-align: center;">
                <tr class="layui-bg-gray">
                    <th style="text-align: center;">项目名称</th>
                    <th style="text-align: center;">选房号数量</th>
                    <th style="text-align: center;">总安置面积(㎡)</th>
                <#if houseHoldAndAreaList?size !=0>
                    <#list houseHoldAndAreaList as houseHoldAndArea>
                        <th style="text-align: center;">
                        ${(houseHoldAndArea.houseHold)!}≥${(houseHoldAndArea.area)!}
                        </th>
                    </#list>
                </#if>
                    <th style="text-align: center;">回购面积(㎡)</th>
                    <th style="text-align: center;">扩购面积(㎡)</th>
                </tr>

            <#assign allChooseNumCountSum = 0/>
            <#assign allKazAreaSum = 0/>
            <#assign allCount1Sum = 0/>
            <#assign allCount2Sum = 0/>
            <#assign allCount3Sum = 0/>
            <#assign allCount4Sum = 0/>
            <#assign allCount5Sum = 0/>
            <#assign allMoreAreaSum = 0/>
            <#assign allLessAreaSum = 0/>
            <#if projectNameList?size !=0>
                <#list projectNameList as projectName>
                    <#assign countMap = (countNumMap[projectName])! />

                    <#assign allChooseNumCountSum = allChooseNumCountSum + countMap['chooseNumCount']!0/>
                    <#assign allKazAreaSum = allKazAreaSum + countMap['kazAreaNum']!0/>
                    <#assign allCount1Sum = allCount1Sum + countMap['count1Num']!0/>
                    <#assign allCount2Sum = allCount2Sum + countMap['count2Num']!0/>
                    <#assign allCount3Sum = allCount3Sum + countMap['count3Num']!0/>
                    <#assign allCount4Sum = allCount4Sum + countMap['count4Num']!0/>
                    <#assign allCount5Sum = allCount5Sum + countMap['count5Num']!0/>
                    <#assign allMoreAreaSum = allMoreAreaSum + countMap['moreArea']!0/>
                    <#assign allLessAreaSum = allLessAreaSum + countMap['lessArea']!0/>

                    <tr>
                        <td style="text-align: center;">${(projectName)!}</td>
                        <td>${(countMap['chooseNumCount'])!0}</td>
                        <td>${(countMap['kazAreaNum'])!0}</td>
                        <#if houseHoldAndAreaList?size !=0>
                            <#list houseHoldAndAreaList as houseHoldAndArea>
                                <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 10>
                                    <td>${(countMap['count1Num'])!0}</td>
                                </#if>
                                <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 20>
                                    <td>${(countMap['count2Num'])!0}</td>
                                </#if>
                                <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 30>
                                    <td>${(countMap['count3Num'])!0}</td>
                                </#if>
                                <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 40>
                                    <td>${(countMap['count4Num'])!0}</td>
                                </#if>
                                <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 50>
                                    <td>${(countMap['count5Num'])!0}</td>
                                </#if>
                            </#list>
                        </#if>
                        <td>${(countMap['moreArea'])!0}</td>
                        <td>${(countMap['lessArea'])!0}</td>
                    </tr>
                </#list>
            </#if>

                <tr bgcolor="#b0c4de">
                    <td>合计</td>
                    <td>${allChooseNumCountSum}</td>
                    <td>${allKazAreaSum}</td>
                <#if houseHoldAndAreaList?size !=0>
                    <#list houseHoldAndAreaList as houseHoldAndArea>
                        <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 10>
                            <td>${allCount1Sum!0}</td>
                        </#if>
                        <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 20>
                            <td>${allCount2Sum!0}</td>
                        </#if>
                        <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 30>
                            <td>${allCount3Sum!0}</td>
                        </#if>
                        <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 40>
                            <td>${allCount4Sum!0}</td>
                        </#if>
                        <#if houseHoldAndArea.sortNum ?? && houseHoldAndArea.sortNum == 50>
                            <td>${allCount5Sum!0}</td>
                        </#if>
                    </#list>
                </#if>
                    <td>${allMoreAreaSum}</td>
                    <td>${allLessAreaSum}</td>

                </tr>
            </table>
        </div>
    </div>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script src="/plugins/jquery/jquery.min.js" charset="utf-8"></script>
<script src="/plugins/tableExcel/jquery.table2excel.js" charset="utf-8"></script>
<script>
    $("#excelBtn").click(function () {
        $(".table").table2excel({
            exclude: ".noExl",
            name: "测算情况汇总表",
            filename: "测算情况汇总表",
            exclude_img: true,
            exclude_links: true,
            exclude_inputs: true
        });
    });
</script>
</body>
</html>